import random


def add(name, *args, **kwargs):
    print(name, args, kwargs)
    # print(name, *args, **kwargs)
    return "hello", "world"


l = [1, 2, 3, 4, 5]
kw = {"age": 12, "address": "天津"}
res, res1 = add("张三", *l, **kw)

print(res, res1)


def a():
    print("AAAAAAAAAA")


def b():
    a()
    print("BBBBBBBBBB")


def c():
    b()
    print("CCCCCCCCCCC")


# 调用b函数
c()


def generate_check_code(num):
    s = '0987654321qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM'
    code = ''
    for i in range(num):
        index = random.randint(0, len(s) - 1)
        code += s[index]
    return code


print(generate_check_code(5))


def login():
    username = input("输入用户名:")
    password = input("输入密码:")
    code = generate_check_code(5)
    print("验证码是:", code)
    code1 = input("输入验证码:")

    if code1.lower() != code.lower():
        print("验证码有误")
        return
    if username == "lijiaqi" and password == '123456':
        print("登录成功")
    else:
        print("用户名或密码错误")


login()
